/////////////////////////////////////////////////////////////////////////
//
// Amuse Engine SDK - core/system/io/platform/posix
// Copyright (c) 2014.  All Rights Reserved
//
// File:		AEPosixStreamReader.h
// Author:		Gianluca Belardelli
// Date:		11/10/2013
//
/////////////////////////////////////////////////////////////////////////
#ifndef _AEPOSIXSTREAMREADER_H_
#define _AEPOSIXSTREAMREADER_H_

class AEPosixStreamReader : public AESeekAndTellStreamReader
{
// Members
protected:
	AEINT32		m_nFileHandle;
	AERESULT	m_nLastError;

// Methods
public:
	static AEPosixStreamReader *Open( const char *lpName );

	AEPosixStreamReader( AEINT32 nFileHanlde );
	virtual ~AEPosixStreamReader( void );

	void Close( void );

	virtual int Read( void *lpBuf, AEINT32 nBytes );
	virtual int Skip( AEINT32 nBytes );
	virtual int Peek( void *lpBuf, AEINT32 nBytes );
	virtual AERESULT GetLastError( void ) const;
	virtual AERESULT Seek( AEINT32 nOffset, AESeekOptions soOpt );
	virtual AEINT32 Tell( void ) const;
};

#endif // _AEPOSIXSTREAMREADER_H_

